package JZOffer;

import java.util.Iterator;
import java.util.Stack;

public class _19 {
    public static void main(String[] args) {
        _19 c = new _19();
        _19.Solution s = c.getSolution();

        System.out.println("finish");

    }

    Solution getSolution() {
        return new Solution();
    }

    class Solution {

        Stack<Integer> stack = new Stack<Integer>();

        public void push(int node) {
            stack.push(node);
        }

        public void pop() {
            stack.pop();
        }

        public int top() {
            return stack.peek();
        }

        public int min() {
            int min = stack.peek();
            int tmp = 0;
            Iterator<Integer> iterator = stack.iterator();
            while (iterator.hasNext()) {
                tmp = iterator.next();
                if (min > tmp) {
                    min = tmp;
                }
            }
            return min;
        }
    }
}
